package com.significantfiles.properties.util.config.converter;

import java.lang.reflect.Constructor;

public class GenericStringBasedConstructorConverter implements Converter<Object> {

	private final Class paramClass;
	private final Constructor constructor;

	public GenericStringBasedConstructorConverter(final Class paramClass, final Constructor constructor) {
		this.paramClass = paramClass;
		this.constructor = constructor;
	}
	
	public Object from(final String input) {
		try {
			return this.constructor.newInstance( input );
		} catch (final Throwable e) {
			final String msg = "";
			
			throw new RuntimeException();
		}
	}

	public String to(final Object object) {
		return String.valueOf( object );
	}

}
